pp108 : Date and Time Functions

Date and Time Functions

This topic describes the various date and time functions available in the default XSLT function library.

Date and time functions are used to manipulate the date and time data of a business object during transformation. These functions play a critical role in handling transactions involving business processes that collaborate from different time zones. You can translate dates that belong to a range of predefined date formats. Refer to Transforming Data using XSLT Functions, for more information on the procedure to transform the data using XSLT functions.

Important:

  • The input parameter for Date functions must be in the following format :
    YYYY-MM-DD or YYYY/MM/DD
  • The input parameter for Date and Time functions must be in the following format :
    YYYY-MM-DDTHH:mm:SS or YYYY-MM-DDTHH:mm:SS.ms.
    If the date is given in any other format, the function assumes the input to be in Current Date and processes it.

The various date and time functions supported, their functionality, and the parameters that have to be specified are described in the following table:

Table 1. Date and Time Functions

Date and Time Function

Description

Parameters

Current Date

Returns the present date in a variety of formats.

The function returns the current date in one of the following formats:

  • DD-MM-YYYY
  • DD/MM/YYYY
  • DD-MM-YYYY HH:mm
  • DD-MM-YYYY HH:mm am/pm
  • DD-MM-YYYY HH:mm:SS
  • DD-MM-YYYY HH:mm:SS am/pm
  • YYYY-MM-DD
  • YYYY-MM-DDTHH:mm:SS
  • YYYY-MM-DDTHH:mm:SS.ms
  • BaanDate ( MMDDYYHHMMSS) - stores dates as the number of days from January 1, 1970 to the specified current date. This returns the current date and time in the format.

Convert Date to specific formats

Returns the specified date in a selected format

Specify the date (in YYYY-MM-DD format) to be converted into the desired format .

Convert Date to  YYYY-MM-DDTHH:mm:SS:ms formats

Converts a date specified in the dd/mm/yy format into a YYYY-MM-DDTHH:mm:SS:ms format.

Specify the date to be converted into the YYYY-MM-DDTHH:mm:SS:ms format.

Date to UTC format

Converts a date into the UTC (Coordinated Universal Time) format.

Specify the date to be converted into the UTC format.

UTC to <other format>

Converts a date in the UTC format into a specified format.

UTC Number - Specify the UTC number to be converted into the specified date format.

Add days to a Date

Adds a specified number of days to a date.

Date - This parameter in the function block takes as input the string value of the date to which a specific number of days have to be added in one of the following formats:

  • YYYY-MM-DDTHH:mm:SS.ms
  • YYYY-MM-DDTHH:mm:SS
  • YYYY-MM-DD
    Number of Days to be Added - The second parameter in the function block takes as input the number of days to be added.